﻿<Controls:MetroWindow  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                       xmlns:vm="clr-namespace:HelpDesk"
                       xmlns:AmmasoConverts="clr-namespace:AmmasoConverts;assembly=AmmasoConverts"
                       xmlns:local="clr-namespace:WPFAutoCompleteTextbox"
                       xmlns:my="clr-namespace:HelpDesk.Commands"
                       xmlns:ViewModel="clr-namespace:HelpDesk.ViewModel"
                       xmlns:UserControls="clr-namespace:HelpDesk.UserControls"
                       xmlns:AmmasoWpfUsersControl="clr-namespace:AmmasoWPFUsersControls;assembly=AmmasoWPFUsersControls"
                       xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                       xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                       xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
                       mc:Ignorable="d"
                       x:Class="HelpDesk.MainWindow"
                       Title="{Binding PublishVersion}"
                       Icon="..\Images\toolbox.png"
                       KeyboardNavigation.ControlTabNavigation="None"
                       Height="{my:SettingBinding Height}"
                       Width="971"
                       Left="{my:SettingBinding Left}"
                       Top="{my:SettingBinding Top}"
                       KeyDown="Window_KeyDown"
                       KeyUp="Window_KeyUp"
                       Activated="Window_Activated"
                       Deactivated="Window_Deactivated">



    <Window.Resources>

        <AmmasoConverts:BoolToVisibility x:Key="BoolToVisibility" />
        <AmmasoConverts:StringToEnable x:Key="StringToEnable" />
        <AmmasoConverts:NullOrEmptyToVisibility x:Key="NullOrEmptyToVisibility" />


        <vm:ComputerCommands x:Key="ComputerCommandviewModel" />
        <vm:UserCommands x:Key="UserCommandsviewModel" />
        <vm:PrinterCommands x:Key="PrinterCommandsviewModel" />
    </Window.Resources>

    <Window.DataContext>
        <ViewModel:MainWindowViewModel MessageBus="{StaticResource APPMessageBus}" />
    </Window.DataContext>

    <Grid>


        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="392*" />
            <ColumnDefinition Width="285*" />
            <ColumnDefinition Width="286*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="28" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <!--StackPanelComputer-->
        <UserControls:MainWindowComputer Grid.Row="1" />

        <!--StackPanelUsers-->
        <UserControls:MainWindowUser Grid.Column="1"
                                     Grid.Row="1" />

        <!--StackPanelPrinter-->
        <StackPanel x:Name="StackPanelPrinter"
                    Grid.Row="1"
                    Grid.Column="2"
                    Margin="0,0,10,0">
            <Grid Height="36"
                  Margin="10,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="82" />
                    <ColumnDefinition Width="137*" />
                    <ColumnDefinition Width="50*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <TextBlock Margin="0,8,10,38"
                           Text="Printer Name" />
                <ComboBox x:Name="txt_PritnerName"
                          Margin="0,3,3,38"
                          Grid.Row="0"
                          Grid.Column="1"
                          ToolTip="Printer name autocomplete from ad"
                          IsEditable="True"
                          ItemsSource="{Binding AllPrinters}" />
                <TextBlock Text="{Binding PrinterCount}"
                           Grid.Column="2"
                           Margin="0,8,10,38" />
            </Grid>
            <StackPanel x:Name="stackPrinterButtons"
                        Margin="10,0,0,0"
                        Grid.Column="1"
                        Grid.Row="1"
                        Orientation="Horizontal"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Top"
                        Width="204"
                        IsEnabled="{Binding Text, Converter={StaticResource StringToEnable}, ElementName=txt_PritnerName}">
                <StackPanel Width="104">
                    <Button Grid.Row="1"
                            Height="28"
                            x:Name="PrinterProperties"
                            Click="PrinterProperties_Click"
                            Content="Properties"
                            Grid.Column="1"
                            Margin="0,5,5,0" />
                    <Button Grid.Row="1"
                            Height="28"
                            x:Name="PrinterQueue"
                            Click="PrinterQueue_Click"
                            Content="Queue"
                            Grid.Column="1"
                            Margin="0,5,5,0" />
                    <Button Grid.Row="1"
                            Height="28"
                            x:Name="PrinterServerRdp"
                            Click="PrinterServerRdp_Click"
                            Content="Server Rdp"
                            Grid.Column="1"
                            Margin="0,5,5,0" />
                    <Button Grid.Row="1"
                            Height="28"
                            x:Name="PrinterPing"
                            Click="PrinterPing_Click"
                            Content="Printer Ping"
                            Grid.Column="1"
                            Margin="0,5,5,0" />
                    <Button Grid.Row="1"
                            Height="28"
                            x:Name="Printerhttp"
                            Click="Printerhttp_Click"
                            Content="Printer Http"
                            Grid.Column="1"
                            Margin="0,5,5,0" />
                    <Button Height="28"
                            x:Name="PrinterTestPage"
                            Click="PrinterTestPage_Click"
                            Content="PrinterTestPage"
                            Margin="0,5,5,0" />
                    <Button Height="28"
                            x:Name="PrinterInkLevel"
                            Click="PrinterInkLevel_Click"
                            Content="Printer Ink Level"
                            Margin="0,5,5,0" />

                </StackPanel>
            </StackPanel>

        </StackPanel>

        <DockPanel Grid.ColumnSpan="3">
            <Menu DockPanel.Dock="Top">
                <MenuItem Header="_File"
                          FontSize="16"
                          Height="auto"
                          Width="Auto">
                    <MenuItem x:Name="MenuOption"
                              Click="MenuOption_Click"
                              Header="_Option">
                        <MenuItem.Icon>
                            <Image Source="..\Images\Options.png"
                                   Width="20"
                                   Height="20"
                                   Margin="0,3,0,0" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <Separator />
                    <MenuItem Header="_Close"
                              x:Name="MenuItemClose"
                              Click="Close_Click">
                        <MenuItem.Icon>
                            <Image Source="..\Images\Close.png"
                                   Width="20"
                                   Height="20"
                                   Margin="0,3,0,0" />
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>
            </Menu>
        </DockPanel>
    </Grid>
</Controls:MetroWindow>
